<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>var和let例子</title>
    <script>
        /* var和let例子 */
        for (var i = 0; i < 10; i++) {
            setTimeout(function() {
                document.write("var声明的变量输出结果为：" + i + "<br/>");
            }, 100)

        }
        for (let j = 0; j < 10; j++) {
            setTimeout(function() {
                document.write("let声明的变量输出结果为：" + j + "<br/>");
            })
        }
    </script>
</head>

<body>

</body>

</html>